package com.tiny.cqzcp.service.impl;

import com.tiny.cqzcp.dao.UserDao;
import com.tiny.cqzcp.dao.UserWalletDao;
import com.tiny.cqzcp.pojo.User;
import com.tiny.cqzcp.pojo.UserWallet;
import com.tiny.cqzcp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author jmz
 */
@Service
public class UserServiceImpl implements UserService {
	

	private UserDao userDao;
	private UserWalletDao walletDao;

	@Autowired
	public UserServiceImpl(UserDao userDao,UserWalletDao walletDao){
		this.userDao = userDao;
		this.walletDao = walletDao;
	}


	@Override
	public User queryUser(String tel) {
		return userDao.selectByPrimaryKey(tel);
	}

	@Override
	public int updateUser(User user) {
		return userDao.update(user);
	}

	@Override
	public int addUserWallet(UserWallet wallet) {
		return walletDao.insert(wallet);
	}

}
